<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcdn.net/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet">
    <title>Grid 布局</title>
    <style>
        .grid{
            width: 300px;
            display: grid;
            /* grid-template-columns: repeat(3, 100px);
            grid-template-rows: repeat(3, 100px); */
            /* grid-template-columns: 100px 1fr 1fr;
            grid-template-rows: repeat(3, 100px); */
            /* grid-template-columns: 50px auto 50px;
            grid-template-rows: repeat(3, 100px); */
            grid-template-columns: repeat(3, 100px);
            grid-template-rows: repeat(3, 100px);
            gap: 5px 5px;
            /* justify-items: stretch; */
            /* align-items: stretch; */
            place-items: stretch stretch;
            grid-auto-flow: row dense;
        }
        .item{
            font-size: 30px;
            background-color: #ccc;
            text-align: center;
        }
        .item:nth-child(1){
            grid-column-start: 1;
            grid-column-end: 3;
        }
        .item:nth-child(2){
            grid-column-start: 1;
            grid-column-end: 4;
        }
    </style>
</head>
<body>
    <div class="grid">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        
        <!-- <div class="item">7</div>
        <div class="item">8</div>
        <div class="item">9</div> -->
    </div>    
</body>
</html>